{%include file="header.html"%}
<style>
input {	width: 80px;}
textarea {	width: 350px;	height:80px;}
tr {height: 48px; }
th {background-color:#f3f3f3; font-size:18px;}
td {font-size:14px;}
</style>
<body>
  <div class="fixed-bar">
    <div class="item-title">
      <h3>订单信息</h3>
      <div style="background:rgba(251,112,45,1);width:125px;height:40px;float:right;text-align:center;border-radius:5px;">
        <a href="order.php?act=list">
          <h5 style="padding:10px;color:#fff;">订单列表</h5>
        </a>
      </div>
    </div> 
  </div>
  <div class="fixed_bottom">
	  <div class="list-div" style="margin-bottom: 5px">
	    <table width="100%" cellpadding="3" cellspacing="1">
  		  <tr>
    		  <th colspan="4">基本设置</th>
  		  </tr>
  		<tr>
    	   <td><div align="right"><strong>订单号：</strong></div></td>
    	   <td>{%$edit.order_sn%}</td>
    	   <td><div align="right"><strong>订单状态：</strong></div></td>
    	   <td>
            {%if $edit.order_status==0%}未确认
            {%elseif $edit.order_status==1 %}已确认
            {%elseif $edit.order_status==2 %}<font color="#FF0000">取消</font>
            {%elseif $edit.order_status==3 %}<font color="#FF0000">无效</font>
            {%elseif $edit.order_status==4 %}<font color="#FF0000">退货</font>
            {%elseif $edit.order_status==5 %}已分单
            {%elseif $edit.order_status==6 %}部分已分单
            {%/if%}&nbsp;&nbsp;
            {%if $edit.pay_status==0%}未付款
            {%elseif $edit.pay_status==1%}付款中
            {%elseif $edit.pay_status==2%}已付款
            {%/if%}&nbsp;&nbsp;
            {%if $edit.shipping_status==0%}未发货
            {%elseif $edit.shipping_status==1%}已发货
            {%elseif $edit.shipping_status==2%}收货确认
            {%elseif $edit.shipping_status==3%}配货中
            {%elseif $edit.shipping_status==4%}已发货(部分商品)
            {%elseif $edit.shipping_status==5%}发货中
            {%/if%}
          </td>
  		  </tr>
  		  <tr>
    	    <td><div align="right"><strong>购货人：</strong></div></td>
    	    <td>{%$edit.user_name%}</td>
    	    <td><div align="right"><strong>下单时间：</strong></div></td>
    	    <td>{%$edit.add_time|date_format:'%Y-%m-%d %H:%M:%I'%}</td>
  		  </tr>
  		  <tr>
    	    <td width="18%"><div align="right"><strong>支付方式：</strong></div></td>
   		    <td width="34%">{%$edit.pay_name%}</td>
    	    <td><div align="right"><strong>付款时间：</strong></div></td>
    	    <td>
           {%if $edit.pay_time==''%}未付款{%else%}
           {%$edit.pay_time|date_format:'%Y-%m-%d %H:%M:%I'%}
           {%/if%}
          </td>
  		  </tr>
  		  <tr>
    	    <td><div align="right"><strong>配送方式：</strong></div></td>
    	    <td>{%$edit.shipping_name%}</td>
          <td><div align="right"><strong>发货时间：</strong></div></td>
          <td>
           {%if $edit.shipping_time==''%}未发货{%else%}
           {%$edit.shipping_time|date_format:'%Y-%m-%d %H:%M:%I'%}
           {%/if%}
          </td>
  		  </tr>
  		  <tr>
          <td><div align="right"><strong>发货单号：</strong></div></td>
          <td>{%$edit.invoice_no%}</td>
    	    <td><div align="right"><strong>订单来源：</strong></div></td>
    	    <td>{%$edit.referer%}</td>
  		  </tr>
  		  <tr>
    	    <th colspan="4">收货人信息</th>
    	  </tr>
  		  <tr>
    	    <td><div align="right"><strong>收货人：</strong></div></td>
    	    <td>{%$edit.consignee|escape%}</td>
    	    <td><div align="right"><strong>电子邮件：</strong></div></td>
    	    <td>{%$edit.email%}</td>
  		  </tr>
  		  <tr>
    	    <td><div align="right"><strong>地址：</strong></div></td>
    	    <td>{%$edit.region%}{%$edit.address|escape%}</td>
    	    <td><div align="right"><strong>邮编：</strong></div></td>
    	    <td>{%$edit.zipcode|escape%}</td>
  		  </tr>
  		  <tr>
    	    <td><div align="right"><strong>电话：</strong></div></td>
    	    <td>{%$edit.tel%}</td>
    	    <td><div align="right"><strong>手机：</strong></div></td>
    	    <td>{%$edit.mobile|escape%}</td>
  		  </tr>
  		  <tr>
    	    <td><div align="right"><strong>标志性建筑：</strong></div></td>
    	    <td>{%$edit.sign_building|escape%}</td>
    	    <td><div align="right"><strong>最佳送货时间：</strong></div></td>
    	    <td>{%$edit.best_time|date_format:'%Y-%m-%d %H:%M:%I'%}</td>
  		  </tr>
	    </table>
    </div>
    <div class="list-div" style="margin-bottom: 5px">
      <table width="100%" cellpadding="3" cellspacing="1">
        <tr>
          <th colspan="8" scope="col">商品信息</th>
        </tr>
        <tr>
          <td><div align="center"><strong>商品名称</strong></div></td>
          <td><div align="center"><strong>货号</strong></div></td>
          <td><div align="center"><strong>价格</strong></div></td>
          <td><div align="center"><strong>数量</strong></div></td>
          <td><div align="center"><strong>属性</strong></div></td>
          <td><div align="center"><strong>库存</strong></div></td>
          <td><div align="center"><strong>小计</strong></div></td>
        </tr>
 	      {%foreach from=$goods_list item=goods key=k%}
        <tr>
          <td><div style="text-align:center">{%$goods.goods_name%}</div></td>
          <td><div style="text-align:center">{%$goods.goods_sn%}</div></td>
          <td><div style="text-align:center">{%$goods.goods_price%}</div></td>
          <td><div style="text-align:center">{%$goods.goods_number%}</div></td>
          <td><div style="text-align:center">{%$goods.goods_attr%}</div></td>
          <td><div style="text-align:center">{%$goods.number%}</div></td>
          <td><div style="text-align:center">{%$goods.goods_price%}</div></td>
        </tr>
        {%/foreach%}
        <tr>
          <td></td>
          <td></td>
          <td></td>
          <td></td>
          <td></td> 
          <td>合计：</td> 
          <td>￥{%$edit.goods_amount%}</td>
        </tr> 
      </table>
      <div class="list-div" style="margin-bottom: 5px">
        <table width="100%" cellpadding="3" cellspacing="1">
          <tr>
            <th colspan="9" scope="col">费用信息</th>
          </tr>
          <tr>
      <td style="text-align:right" width="100%">
      <div >
      商品总金额:<strong>￥{%$edit.goods_amount%}元</strong>
      - 折扣:<strong>￥{%$edit.discount%}元</strong>  
      + 发票税额:<strong>￥{%$edit.tax%}元</strong>
      + 配送费用:<strong>￥{%$edit.shipping_fee%}元</strong>
      + 保价费用:<strong>￥{%$edit.insure_fee%}元</strong>
      + 支付费用:<strong>￥{%$edit.pay_fee%}元</strong>
      + 包装费用:<strong>￥{%$edit.pack_fee%}元</strong>
      + 贺卡费用:<strong>￥{%$edit.card_fee%}元</strong>
      </div>
      </td>
      </tr>
       <tr>
      <td style="text-align:right" width="100%">
          =订单总金额:<strong>￥{%$edit.total_fee%}元</strong>
      </td>
    </tr>
    <tr>
      <td>
        <div align="right">
          -已付金额:<strong>￥{%$edit.money_paid%}元</strong>
          -使用余额:<strong>￥{%$edit.surplus%}元</strong>
          -使用积分:<strong>￥{%$edit.integral_money%}元</strong>
          -使用红包:<strong>￥{%$edit.bonus%}元</strong>
        </div>
      </td>
      </tr>
      <tr>
      <td>
       <div align="right">
        =应付款金额:<strong>￥{%$edit.order_amount%}元</strong>
        </div>
      </td>
    </tr>
</table>
</div>
<div class="list-div" style="margin-bottom: 5px">
<table width="100%" cellpadding="3" cellspacing="1">
  <tr>
    <th colspan="8" scope="col">操作信息</th>
    </tr>
    <tr>
      <td colspan="3"><div align="right" >操作备注：  &nbsp;&nbsp;&nbsp;&nbsp; </div></td>
      <td colspan="5">
       <textarea name="action_note" cols="192" rows="3"></textarea>
      </td>
    </tr>
    <form method="post" action="order.php" enctype="multipart/form-data" id="aspnetForm" name="form1">
    <input type="hidden" name="act" value="upd">
    <input type="hidden" name="order_id" value='{%$edit.order_id%}'>
      <tr>
      <td colspan="3"><div align="right" >当前执行操作：  &nbsp;&nbsp;&nbsp;&nbsp; </div></td>
      <td>
        {%if $edit.order_status==0%}
        <input type="submit" name='confirm' value="确认">
        <input type="submit" name='payment' value="付款">
        <input type="submit" name='cancel' value="取消">
        <input type="submit" name='invalid' value="无效">
        <input type="hidden" name='order_amount' value="{%$edit.order_amount%}">
        {%elseif $edit.order_status==1 && $edit.pay_status==0%}
        <input type="submit" name='payment' value="付款">
        <input type="submit" name='cancel' value="取消">
        <input type="submit" name='invalid' value="无效">
        <input type="hidden" name='order_amount' value="{%$edit.order_amount%}">
        {%elseif $edit.order_status==2%}
        <input type="submit" name='confirm' value="确认">
        {%elseif $edit.order_status==3%}
        <input type="submit" name='confirm' value="确认">
        {%elseif $edit.order_status==4%}
        <input type="submit" name='confirm' value="确认">
        {%elseif $edit.order_status==1 && $edit.pay_status==2%}
        <input type="submit" name='unpaid' value="设为未付款">
        <input type="submit" name='invoice' value="生成发货单">
        <input type="submit" name='cancel' value="取消">
        <input type="hidden" name='order_amount' value="{%$edit.money_paid%}">
        {%elseif $edit.order_status==5 && $edit.pay_status==2 && $edit.shipping_status==0%}
        <input type="submit" name='unpaid' value="设为未付款">
        <input type="submit" name='invoice' value="生成发货单">
        <input type="submit" name='cancel' value="取消">
         <input type="hidden" name='order_amount' value="{%$edit.money_paid%}">
        {%elseif $edit.order_status==5 && $edit.pay_status==2 && $edit.shipping_status==1%}
        <input type="submit" name='notshipped' value="未发货">
        <input type="submit" name='receivedgoods' value="已收货">
        <input type="submit" name='returngoods' value="退货"> 
        <input type="hidden" name='order_amount' value="{%$edit.money_paid%}">
        {%elseif $edit.order_status==5 && $edit.pay_status==2 && $edit.shipping_status==2%}
        <input type="submit" name='notshipped' value="未发货">
        <input type="submit" name='returngoods' value="退货"> 
        <input type="hidden" name='order_amount' value="{%$edit.money_paid%}">
        {%elseif $edit.order_status==5 && $edit.pay_status==2 && $edit.shipping_status==5%}
        <input type="submit" name='delivery' value="去发货">
        {%/if%}
      </td>
    </tr>
    </from>
    
</table>
</div>
  <table align="center;" class="table tb-type2">
  <thead>
        <tr>
          <th><a>操作者</a></th>
          <th><a>操作时间</a></th>
          <th><a>订单状态</a></th>
          <th><a>付款状态</a></th>
          <th><a>发货状态</a></th>
        </tr>
      {%foreach from=$order_log item=list key=k%}
        <tr>
        <td align="center">{%$list.action_user%}</td>
        <td align="center">{%$list.log_time|date_format:'%Y-%m-%d %H:%M:%I'%}</td>
        <td align="center">
          {%if $list.order_status==0%}未确认
          {%elseif $list.order_status==1 %}已确认
          {%elseif $list.order_status==2 %}<font color="#FF0000">取消</font>
          {%elseif $list.order_status==3 %}<font color="#FF0000">无效</font>
          {%elseif $list.order_status==4 %}<font color="#FF0000">退货</font>
          {%elseif $list.order_status==5 %}已分单
          {%elseif $list.order_status==6 %}部分已分单
        {%/if%}</td>
        <td align="center">{%if $list.pay_status==0%}未付款
          {%elseif $list.pay_status==1%}付款中
          {%elseif $list.pay_status==2%}已付款
        {%/if%}</td>
        <td align="center">{%if $list.shipping_status==0%}未发货
          {%elseif $list.shipping_status==1%}已发货
          {%elseif $list.shipping_status==2%}收货确认
          {%elseif $list.shipping_status==3%}配货中
          {%elseif $list.shipping_status==4%}已发货(部分商品)
          {%elseif $list.shipping_status==5%}发货中
        {%/if%}</td>
        </tr>
    {%/foreach%}
      </thead>

</table>
</div>